package com.tulingxueyuan.mall.common;

import com.tulingxueyuan.mall.modules.oms.service.OmsOrderItemService;
import com.tulingxueyuan.mall.modules.oms.service.OmsOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

//订单超时取消并解锁库存的定时器
@Component
@Slf4j
public class OrderTimeOutSender {
    @Autowired
    OmsOrderService orderService;
    @Scheduled(cron = "0 0/1 * ? * ?")
    private void cancelOverTimeOrder(){
        log.info("-----------订单超时取消并解锁库存的定时器开始执行----------------");
        orderService.cancelOverTimeOrder();
        log.info("-----------订单超时取消并解锁库存的定时器执行完毕----------------");
    }
}
